import { functionCommon, requestCommon } from "@whzhuke/common"

export default {
  list: (params: any) => {
    return requestCommon.get<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods/`,
      params
    })
  },//查询商品分页列表
  pricelist: (params: any) => {
    return requestCommon.get<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods/price/units`,
      params
    })
  },//货币单位列表
  unitslist: (params: any) => {
    return requestCommon.get<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods/units`,
      params
    })
  },//单位列表
  add: (params: any) => {
    return requestCommon.postJson<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods/`,
      params
    })
  },//添加商品
  edit: (params: any) => {
    return requestCommon.put<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods/`,
      params
    })
  },//修改商品信息
  del: (params: any) => {
    return requestCommon.del<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods/images/${params.id}`,
      params
    })
  },//删除商品图片
  item: (params: any) => {
    return requestCommon.get<any>({
      url: `${functionCommon.requestHost("api")}/v1/m/goods/${params.id}`
    })
  }//查询商品详情



}
